<%@ page import="org.apache.shiro.subject.Subject" %>
<%@ page import="org.apache.shiro.SecurityUtils" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>首页</title>
</head>
<body>
<%
    Subject subject = SecurityUtils.getSubject();
    if(subject.isAuthenticated()){
%>
        当前用户 : <%=subject.getPrincipal()%>
        <a href="${pageContext.request.contextPath}/logout">退出</a>
        <a href="${pageContext.request.contextPath}/userAdd">创建用户</a>
<%
    }
    else{
%>
        <a href="${pageContext.request.contextPath}/login">登录</a>
<%
    }
%>
</body>
</html>
